<?php

use App\Models\Config;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateConfigsTable extends Migration
{
    public function up()
    {
        Schema::create('configs', function (Blueprint $table) {
            $table->id();
	        $table->string('system_name')->default('System Name');
	        $table->string('alipay_route')->default('YJEG1');
	        $table->string('adapay_route')->default('YJEG1');
	        $table->string('logo')->nullable();
	        $table->string('copyright')->nullable();
	        $table->string('icp_bei')->nullable();
	        $table->string('icp_zheng')->nullable();
	        $table->string('gongan_bei')->nullable();
	        $table->string('phone')->nullable();
	        $table->string('address')->nullable();
	        $table->string('serve_qrcode')->nullable();
	        $table->text('about_us')->nullable();
	        $table->text('user_agreement')->nullable();
	        $table->text('privacy_agreement')->nullable();
	        $table->text('service_agreement')->nullable();
	        $table->text('user_usage')->nullable();
        });

	    Config::create(['system_name' => 'System Name']);
    }

    public function down()
    {
        Schema::dropIfExists('configs');
    }
}
